#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# 检测当前使用的包管理器
executor="pnpm"
if command -v npm &> /dev/null && [ "$npm_execpath" != "" ]; then
  if echo "$npm_execpath" | grep -q "npm"; then
    executor="npm"
  fi
fi

# 执行commitlint命令
echo "Using $executor to run commitlint..."
$executor commitlint